package com.tte.common.utils.tree;

/**
 * TreeMain
 * @Author: DongWH
 * @Date: 2022/11/9 14:15
 */
public class TreeMain {
    public static void main(String[] args) {
        //List dtoList = BeanMapper.mapList(menuList,MenuTreeDto.class);
//        if(dtoList!=null && dtoList.size()>0) {
//            TreeUtil treeUtil = new TreeUtil();
//            List<MenuTreeDto> treeList = treeUtil.getChildTreeObjects(dtoList, parentId);
//            return treeList;
//        }

        //生成树的结构示例：菜单树JSON
        /*{
            "success": true,
                "message": "请求成功",
                "data": [
            {
                "id": "1",
                    "menuName": "系统管理",
                    "menuType": 1,
                    "menuCode": "sys",
                    "parentId": "0",
                    "sortNo": 50,
                    "expand": 0,
                    "isShow": 1,
                    "permission": "sys",
                    "comt": "test",
                    "enable": 1,
                    "iconcls": "fa fa-angle-right",
                    "request": "#",
                    "children": [
                {
                    "id": "16",
                        "menuName": "用户角色",
                        "menuType": 1,
                        "menuCode": "user.role",
                        "parentId": "1",
                        "sortNo": 11,
                        "expand": 0,
                        "isShow": 0,
                        "permission": "user.role",
                        "comt": null,
                        "enable": 1,
                        "iconcls": "fa fa-users",
                        "request": "app.sys.userroles",
                        "children": null,
                        "name": "用户角色"
                },
                {
                    "id": "17",
                        "menuName": "权限管理",
                        "menuType": 1,
                        "menuCode": "sys.access",
                        "parentId": "1",
                        "sortNo": 12,
                        "expand": 0,
                        "isShow": 1,
                        "permission": "sys.access",
                        "comt": null,
                        "enable": 1,
                        "iconcls": "fa fa-list",
                        "request": "app.sys.auth",
                        "children": null,
                        "name": "权限管理"
                },
                {
                    "id": "18",
                        "menuName": "系统日志",
                        "menuType": 1,
                        "menuCode": "sys.syslog",
                        "parentId": "1",
                        "sortNo": 22,
                        "expand": 1,
                        "isShow": 1,
                        "permission": "sys.syslog",
                        "comt": null,
                        "enable": 1,
                        "iconcls": "fa fa-list",
                        "request": "app.syslog",
                        "children": null,
                        "name": "系统日志"
                },
                {
                    "id": "19",
                        "menuName": "业务日志",
                        "menuType": 1,
                        "menuCode": "sys.log.business",
                        "parentId": "1",
                        "sortNo": 999,
                        "expand": 1,
                        "isShow": 1,
                        "permission": "sys.log.business",
                        "comt": null,
                        "enable": 1,
                        "iconcls": "fa fa-list",
                        "request": "app.businesslog",
                        "children": null,
                        "name": "业务日志"
                },
                {
                    "id": "2",
                        "menuName": "用户管理",
                        "menuType": 1,
                        "menuCode": "sys.user",
                        "parentId": "1",
                        "sortNo": 1,
                        "expand": 0,
                        "isShow": 1,
                        "permission": "sys.user",
                        "comt": null,
                        "enable": 1,
                        "iconcls": "fa fa-user",
                        "request": "app.user",
                        "children": null,
                        "name": "用户管理"
                },
                {
                    "id": "3",
                        "menuName": "部门管理",
                        "menuType": 1,
                        "menuCode": "sys.dept",
                        "parentId": "1",
                        "sortNo": 2,
                        "expand": 0,
                        "isShow": 1,
                        "permission": "sys.dept",
                        "comt": null,
                        "enable": 1,
                        "iconcls": "fa fa-users",
                        "request": "app.dept",
                        "children": null,
                        "name": "部门管理"
                },
                {
                    "id": "4",
                        "menuName": "菜单管理",
                        "menuType": 1,
                        "menuCode": "sys.menu",
                        "parentId": "1",
                        "sortNo": 3,
                        "expand": 0,
                        "isShow": 1,
                        "permission": "sys.menu",
                        "comt": null,
                        "enable": 1,
                        "iconcls": "fa fa-bars",
                        "request": "app.menu",
                        "children": null,
                        "name": "菜单管理"
                },
                {
                    "id": "5",
                        "menuName": "角色管理",
                        "menuType": 1,
                        "menuCode": "sys.role",
                        "parentId": "1",
                        "sortNo": 4,
                        "expand": 0,
                        "isShow": 1,
                        "permission": "sys.role",
                        "comt": null,
                        "enable": 1,
                        "iconcls": "fa fa-cog",
                        "request": "app.role",
                        "children": null,
                        "name": "角色管理"
                },
                {
                    "id": "6",
                        "menuName": "会话管理",
                        "menuType": 1,
                        "menuCode": "sys.session",
                        "parentId": "1",
                        "sortNo": 6,
                        "expand": 0,
                        "isShow": 0,
                        "permission": "sys.session",
                        "comt": null,
                        "enable": 1,
                        "iconcls": "fa fa-list",
                        "request": "main.sys.session.list",
                        "children": null,
                        "name": "会话管理"
                },
                {
                    "id": "7",
                        "menuName": "字典管理",
                        "menuType": 1,
                        "menuCode": "sys.dic",
                        "parentId": "1",
                        "sortNo": 7,
                        "expand": 0,
                        "isShow": 1,
                        "permission": "sys.dic",
                        "comt": null,
                        "enable": 1,
                        "iconcls": "fa fa-book",
                        "request": "app.dictindex",
                        "children": null,
                        "name": "字典管理"
                },
                {
                    "id": "8",
                        "menuName": "业务参数",
                        "menuType": 1,
                        "menuCode": "sys.param",
                        "parentId": "1",
                        "sortNo": 8,
                        "expand": 0,
                        "isShow": 0,
                        "permission": "sys.param",
                        "comt": null,
                        "enable": 1,
                        "iconcls": "fa fa-wrench",
                        "request": "main.sys.param.list",
                        "children": null,
                        "name": "业务参数"
                },
                {
                    "id": "20",
                        "menuName": "数据权限",
                        "menuType": 1,
                        "menuCode": "sys.dataauth",
                        "parentId": "1",
                        "sortNo": 20,
                        "expand": 1,
                        "isShow": 1,
                        "permission": "sys.dataauth",
                        "comt": null,
                        "enable": 1,
                        "iconcls": "fa fa-users",
                        "request": "app.dataauth",
                        "children": null,
                        "name": "数据权限"
                }
            ],
                "name": "系统管理"
            },
            {
                "id": "9",
                    "menuName": "调度中心",
                    "menuType": 1,
                    "menuCode": "task",
                    "parentId": "0",
                    "sortNo": 2,
                    "expand": 0,
                    "isShow": 0,
                    "permission": "task",
                    "comt": null,
                    "enable": 1,
                    "iconcls": "fa fa-angle-right",
                    "request": "#",
                    "children": [
                {
                    "id": "10",
                        "menuName": "任务组管理",
                        "menuType": 1,
                        "menuCode": "task.group",
                        "parentId": "9",
                        "sortNo": 1,
                        "expand": 0,
                        "isShow": 0,
                        "permission": "task.group",
                        "comt": null,
                        "enable": 1,
                        "iconcls": "fa fa-tasks",
                        "request": "main.task.group.list",
                        "children": null,
                        "name": "任务组管理"
                },
                {
                    "id": "11",
                        "menuName": "任务管理",
                        "menuType": 1,
                        "menuCode": "task.scheduler",
                        "parentId": "9",
                        "sortNo": 2,
                        "expand": 0,
                        "isShow": 0,
                        "permission": "task.scheduler",
                        "comt": null,
                        "enable": 1,
                        "iconcls": "fa fa-table",
                        "request": "main.task.scheduler.list",
                        "children": null,
                        "name": "任务管理"
                },
                {
                    "id": "12",
                        "menuName": "调度管理",
                        "menuType": 1,
                        "menuCode": "task.scheduled",
                        "parentId": "9",
                        "sortNo": 3,
                        "expand": 0,
                        "isShow": 0,
                        "permission": "task.scheduled",
                        "comt": null,
                        "enable": 1,
                        "iconcls": "fa fa-user",
                        "request": "main.task.scheduled.list",
                        "children": null,
                        "name": "调度管理"
                },
                {
                    "id": "13",
                        "menuName": "调度日志",
                        "menuType": 1,
                        "menuCode": "task.log",
                        "parentId": "9",
                        "sortNo": 4,
                        "expand": 0,
                        "isShow": 0,
                        "permission": "task.log",
                        "comt": null,
                        "enable": 1,
                        "iconcls": "fa fa-list",
                        "request": "main.task.log.list",
                        "children": null,
                        "name": "调度日志"
                },
                {
                    "id": "15",
                        "menuName": "角色权限",
                        "menuType": 1,
                        "menuCode": "role.access",
                        "parentId": "9",
                        "sortNo": 11,
                        "expand": 1,
                        "isShow": 1,
                        "permission": "role.access",
                        "comt": null,
                        "enable": 1,
                        "iconcls": "fa fa-list",
                        "request": "app.sys.roleaccess",
                        "children": null,
                        "name": "角色权限"
                }
            ],
                "name": "调度中心"
            }
    ]
        }*/
    }
}
